package com.util;

import com.alibaba.fastjson.JSONObject;


/**
 * 辅助类
 * 
 */
public class MessageUtil {


	/**
	 * 消息创建
	 * 
	 * @param code
	 * @param messageBuilder
	 * @return
	 */
	public static PBMessage buildMessage(short code, JSONObject  message) {
		PBMessage response = new PBMessage(code, -1);
		response.buildPBMessage(message);
		return response;
	}

	/**
	 * 消息创建
	 * 
	 * @param code
	 * @param client
	 * @param messageBuilder
	 * @return
	 */
	public static PBMessage buildMessage(short code, int client, JSONObject jso) {
		PBMessage response = new PBMessage(code, client);
		response.setMessage(jso);
		return response;
	}

	/**
	 * 消息创建
	 * 
	 * @param code
	 * @param client
	 * @return
	 */
	public static PBMessage buildMessage(short code, int client) {
		PBMessage message = new PBMessage(code, client);
		return message;
	}

}
